#ifndef __CK_MODULE_MANAGER_H__
#define __CK_MODULE_MANAGER_H__

#include "zCore.h"
#include <vector>

namespace ck
{
	class Module;
	class Connection;
	class Operator;

	class ZCORE_API ModuleManager
	{
	protected:
		ModuleManager();
		virtual ~ModuleManager();

	public:
		static ModuleManager*	GetInstance();

	public:
		RESULTCODE	Load();
		Module*		LoadModule(const char* szName);
		
		RESULTCODE	RegisterModule(const char* szName);

		z_uint32	GetCount();
		Module*		GetModule(z_uint32 i);
		Module*		GetModuleByCode(z_uint32 code);

		bool		Find(const char* szName);

		Operator*	GetOperator(z_uint32 opcode);

	public:
		void		SetConnection(Connection* pConnection);

	private:
		Connection*	m_pConnection;
		std::vector<Module*>	m_modules;

	};
}

#endif //__CK_MODULE_MANAGER_H__
